<%@ page import="com.shamar.blog.entity.BlogUser" %>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!--输出,条件,迭代标签库-->
<%@ page isELIgnored="false" %><!DOCTYPE html>
<%!
        public BlogUser blogUser;
        //        public Boolean isLogin;
        public Integer loginId;
%>
<%
        blogUser = (BlogUser) session.getAttribute("currentBlogUser");
        if (blogUser!=null) {
                loginId = blogUser.getId();
                request.setAttribute("loginId", loginId);
//                isLogin = true;}
        }
//        else{
//                isLogin=false;
//        }

%>
<!doctype html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="lt-ie9 lt-ie8" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="lt-ie9" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-US"> <!--<![endif]-->
<head>
        <!-- META TAGS -->
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <title>${blogContent.title}</title>
        <link rel="shortcut icon " type="images/x-icon" href="me.ico">
        <link rel='stylesheet' href='css/blog.css' type='text/css' media='all' />
        <link rel='stylesheet'  href='css/nprogress.css' type='text/css' media='all' />

        <!-- Style Sheet-->
        <%--引入js文件--%>
        <%@include file="include_js.jsp" %>
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <script src="js/toastr.min.js"></script>
        <script type='text/javascript' src='js/nprogress.js'></script>
        <script src="js/userspace/blog.js"></script>

</head>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<body>
<!-- Start of Header -->
<script>
    NProgress.start();
</script>
<%@include file="header_bar.jsp" %>
<link rel='stylesheet' href='css/bootstrap.min.css' type='text/css' media='all' />
<link rel='stylesheet' href='css/font-awesome.min.css' type='text/css' media='all' />
<link rel='stylesheet' href='css/thinker-md.vendor.css' type='text/css' media='all' />
<!-- End of Header -->
<!-- Start of Page Container -->
<div class="container blog-content-container">
    <ul class="breadcrumb">
        <li><a href="/community/index">博客分享社区</a><span class="divider">/</span></li>
        <li><a href="/community/articles_list?cid=${blogContent.categoryId}" title="查看 ${blogContent.categoryName}分类下所有博客">${blogContent.categoryName}</a> <span class="divider">/</span></li>
        <li class="active">${blogContent.title}</li>
    </ul>
        <div class="row">
                <!-- Blog Entries Column -->
                <div class="col-md-8">

                        <!-- Blog Post -->
                        <div class="card mb-4">
                                <div class="card-block">
                                        <h2 class="card-title">
							<span>
<%--                                用户这里暂时先写死,后续再进行改动--%>
			                  <a href="/" title="shamar" >
			                    <img src="/upload/images/user/1/2018121722480427325.jpg" class="blog-avatar-50">
			                  </a>
					        </span>
                                                <a href="#" class="card-link" title="shamar">
                                                    ${blogContent.title}
                                                </a>
                                        </h2>
                                        <div class="card-text">
                                                <a href="#" class="card-link" >shamar</a> 发表于  <fmt:formatDate type="both" value="${blogContent.pushtime}" pattern="yyyy年-MM月-dd日 HH时-mm分"/>                                                 <i class="fa fa-eye" aria-hidden="true">1</i>
                                                <i class="fa fa-heart-o" aria-hidden="true">2</i>
                                                <i class="fa fa-comment-o" aria-hidden="true">3</i>
                                            <c:if test="${blogContent.userId == loginId && blogContent.userId!=null}">
                                                <a href="/community/edit_blog?id=${blogContent.id}" class="btn btn-primary float-right" title="编辑">编辑</a>
                                                <a href="javascript:void(0)" class="btn btn-primary float-right blog-delete-blog" title="删除" onclick="return confirm('确定删除?')">删除</a>
                                            </c:if>
                                        </div>
                                        <hr>
                                        <article class="post-content">
                                            ${blogContent.htmlContent}
                                        </article>
                                        <hr>
                                </div>
                                <div class="card-block">


                                        <h5>分类：<a>
                                                ${blogContent.categoryName}
                                        </a></h5>

                                        <h5 >标签：
                                                <a> <span class="badge badge-default">Web Design</span></a>
                                        </h5>
                                </div>

                                <div class="card-block">


                                        <h5>评论：</h5>
                                        <div class="row">
                                                <div class="col-lg-12">
                                                        <textarea class="blog-textarea" placeholder="看帖需留言~" id="commentContent"></textarea>
                                                </div>
                                        </div>
                                        <button class="btn btn-primary float-right" id="submitComment">发表评论</button>
<%--                                        <button class="btn btn-primary float-right" id="submitVote">点赞</button>--%>
<%--                                        <button class="btn btn-primary float-right" id="cancelVote">取消点赞</button>--%>
                                </div>
                        </div>

                </div>

        </div>
        <!-- /.row -->
    <script>
        NProgress.done();
    </script>
</div>
<!-- End of Page Container -->

<!-- JavaScript -->
</body>
</html>